package com.wtx.chapter03;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @description: Stream api
 * @author: wtx
 * @createDate: 2020/5/31
 */
public class Test1 {

    public static void main(String[] args) {

        //4、flatMap: 可用Stream替换值, 然后将多个Stream连接成一个Stream
        List<Integer> list = Stream.of(Arrays.asList(1, 2), Arrays.asList(3, 4))
                .flatMap(number -> number.stream())
                .collect(Collectors.toList());
        System.out.println(Arrays.asList(1,2,3,4).equals(list));  //true

        //5、max、min: 最大值和最小值
        
    }
}
